import Vue from 'vue'

import 'normalize.css/normalize.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/styles/index.scss'
import '@/assets/styles/nami.scss'
import App from './App'
import store from './store'
import router from './router'
import directive from './directive'
import plugins from './plugins'
import { download } from '@/utils/request'

import '@/icons'
import '@/permission'
import { getDicts } from "@/api/system/dict/data"; //根据类型获取字典的API方法
import {  addDateRange, parseTime, resetForm, handleTree, selectDictLabel } from "@/utils/nami";
// 分页组件
import Pagination from "@/components/Pagination";
import DictTag from '@/components/DictTag' // 字典标签组件
import DictData from '@/components/DictData' // 字典数据组件
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"

// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.component('Pagination', Pagination)
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.handleTree = handleTree
Vue.prototype.download = download

// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('RightToolbar', RightToolbar)

Vue.use(directive)
Vue.use(plugins)
Vue.use(ElementUI)
DictData.install()

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
